﻿@model IEnumerable<TGBTech.Core.Models.DanhMuc.KhachHang>

@{
    ViewBag.Title = "Khách Hàng";
}

<div class="row">
    <div class="col-md-12">
        <!-- BEGIN EXAMPLE TABLE PORTLET-->
        <div class="portlet box blue">
            <div class="portlet-title">
                <div class="caption">Khách hàng</div>
                <div class="tools">
                    <a href="javascript:;" class="collapse"></a>
                    <a href="#portlet-config" data-toggle="modal" class="config"></a>
                    <a href="javascript:;" class="reload"></a>
                </div>
            </div>
            <div class="portlet-body">
                <div class="table-toolbar">
                    <div class="table-toolbar">
                        <a class="btn green" data-toggle="modal" href="#createKhachHang">Thêm mới</a>
                    </div>
                    <table class="table table-striped table-bordered table-hover" id="tableKhachHang">
                        <thead>
                            <tr>
                                <th class="table-checkbox"><input type="checkbox" class="group-checkable" data-set="#tableKhachHang .checkboxes" /></th>
                                <th><b>Mã KH</b></th>
                                <th><b>Tên KH</b></th>
                                <th><b>Địa chỉ</b></th>
                                <th><b>Điện thoại</b></th>
                                <th><b>Fax</b></th>
                                <th><b>MST</b></th>
                                <th></th>
                                <th></th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (var item in Model)
                            {
                                <tr class="odd gradeX">
                                    <td><input type="checkbox" class="checkboxes" value="1" /></td>
                                    <td>@item.Id</td>
                                    <td>@item.Name</td>
                                    <td>@item.Address</td>
                                    <td>@item.Phone</td>
                                    <td>@item.Fax</td>
                                    <td>@item.MST</td>
                                    <td><a data-toggle="modal" class="btnEditKhachHang" id="@item.Id" href="#editKhachHang">Sửa</a></td>
                                    <td><a data-toggle="modal" class="btnDeleteKhachHang" id="@item.Id" href="#editKhachHang">Xóa</a></td>
                                </tr>
                            }

                        </tbody>
                    </table>
                </div>
            </div>
            <!-- END EXAMPLE TABLE PORTLET-->
        </div>
    </div>
</div>
<div class="modal fade" id="createKhachHang" tabindex="-1" aria-hidden="false">
    <div class="modal-dialog">
        <div class="modal-body" data-url=@Html.Action("Create")</div>
    </div>
</div>

<div class="modal fade" id="editKhachHang" tabindex="-1" aria-hidden="false">
    <div class="modal-dialog">
        <div class="modal-body" id="bodyEditKhachHang"</div>
    </div>
</div>
